
import { _decorator, Component, Node, director, sys, ProgressBar, tween } from 'cc';
import { SoltaireGame } from './SoltaireGame';
import GameManager from './tool/GameManager';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = SolitaireLoaLoding
 *
 */
 
@ccclass('LoadSceneProgressBar')
export class LoadSceneProgressBar extends Component {
    static instance:LoadSceneProgressBar=null!
    @property(ProgressBar)
    jindutiao: ProgressBar= null!;
    
    @property(Node)
    bg: Node= null!;
    onLoad()
    {
        LoadSceneProgressBar.instance=this;
    }
    start () {
        // [3]
    }

    OpenScene(name:string)
    {
        this.bg.active=true;
        tween(this.jindutiao).to(1, {progress:0.9}).call(()=>{
            director.loadScene(name);
        }).start()


    }

}


